#!/usr/bin/python -S
"""
exceptions.py
"""

__author__ = 'Andy Chu'


class Error(Exception):
  pass

class CompilationError(Error):
  """Base class for errors that happen during the compilation stage."""

class BadFilter(CompilationError):
  """Can't find the named filter"""

class BadPattern(CompilationError):
  """Can't find the named pattern"""

class PatternSyntaxError(CompilationError):
  """Syntax error in the pattern text."""

class CaptureError(Error):
  """Base class for errors that happen when capturing fields."""
  def __init__(self, msg, original_exception=None):
    Error.__init__(self, msg)
    self.original_exception = original_exception


